package com.rizzo.back.exception;

/**
 * ApplicationExceptionItem are used within ApplicationExceptions.
 * ApplicationExceptions are used to provide feedback to the user interface.
 * <p/>
 * ApplicationExceptionsItems contain a developer message,
 * a msgKey that refers to a key in a properties file with the visible error message,
 * and the parameters used in that key
 *
 * @author Jan Lievens
 */
public class ApplicationExceptionItem {

    private String developerMessage;
    private String msgKey;
    private Object[] msgParams;

    /**
     * Constructor for use in subclasses.
     *
     * @param developerMessage A developer message that states technical details of the error.
     * @param msgKey           The key in the FlowResourceBundle or ApplicationResourceBundle.
     * @param msgParams        The parameters that will fill in the message.
     */
    public ApplicationExceptionItem(String developerMessage, String msgKey, Object... msgParams) {
        this.developerMessage = developerMessage;
        this.msgKey = msgKey;
        this.msgParams = msgParams;
    }

    /**
     * Method getMsgKey returns the msgKey of this ApplicationExceptionItem object.
     *
     * @return the msgKey (type String) of this ApplicationExceptionItem object.
     */
    public String getMsgKey() {
        return msgKey;
    }

    /**
     * Method getMsgParams returns the msgParams of this ApplicationExceptionItem object.
     *
     * @return the msgParams (type Object[]) of this ApplicationExceptionItem object.
     */
    public Object[] getMsgParams() {
        return msgParams;
    }

    /**
     * Method getDeveloperMessage returns the developerMessage of this ApplicationExceptionItem object.
     *
     * @return the developerMessage (type String) of this ApplicationExceptionItem object.
     */
    public String getDeveloperMessage() {
        return developerMessage;
    }
}